<?php
/**
 * 同步部分
 * 
 * @package ews
 * @ews Enterprise WorkShop
 * @version 1.0 alpha
 * @since 2011-05-11
 * @author monkee
 */

class syncModel extends model
{
	public function username($username){
		$sql = 'SELECT username FROM '.DB::table('user');
		if($username){
			$sql .= ' WHERE username LIKE "'.DB::escape_string($username).'%"';
		}
		$sql .= ' LIMIT 10';
		$row = DB::fetchArray($sql);
		$res = array();
		foreach($row as $item){
			$res[] = $item['username'];
		}
		return $res;
	}
}
?>